package top.wilbert.collegelink.forum.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import top.wilbert.collegelink.forum.entity.CommentEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import top.wilbert.collegelink.forum.vo.CommentResponseVo;

import java.util.List;

/**
 * @author Augus
 * @email 2531496343@qq.com
 * @date 2023-02-28 20:44:25
 */
@Mapper
public interface CommentDao extends BaseMapper<CommentEntity> {

    List<CommentResponseVo> selectLevel1CommentResponseVo(IPage<CommentResponseVo> page, @Param("targetId") Long targetId, @Param("targetType") Integer targetType);

    List<CommentResponseVo> selectLevel2CommentResponseVo(IPage<CommentResponseVo> page, @Param("pid") Long pid);

    void addLikeCount(@Param("commentId") Long commentId);

    void reduceLikeCount(@Param("commentId") Long commentId);
}
